// eslint-disable-next-line import/no-extraneous-dependencies
import { Request, Response } from 'express';

export default {
  'POST /_api/goods/getTable': getTable,
  'POST /_api/goods/getSKU': getSKU,
  'POST /_api/goods/getTypes': getTypes,
};

function getTable(_req: Request, res: Response) {
  const data = [
    {
      numberid: '1',
      name: '京东',
      nameValue: '10000001',
    },
    {
      numberid: '2',
      name: '京东',
      nameValue: '10000001',
    },
    {
      numberid: '3',
      name: '京东',
      nameValue: '10000001',
    },
    {
      numberid: '4',
      name: '京东',
      nameValue: '10000001',
    },
  ];
  return res.json(data);
}

function getSKU(_req: Request, res: Response) {
  const data = [
    {
      numberid: '1',
      name: '京东',
      code: 'JD245001-01',
      productCode: '245001-01',
      productName: '商品名称',
      color: '红色',
      productStatus: true,
      size: '小',
      type: '时尚',
    },
    {
      numberid: '2',
      name: '京东',
      code: 'JD245001-01',
      productCode: '245001-01',
      productName: '商品名称',
      productStatus: true,
      color: '红色',
      size: '小',
      type: '时尚',
    },
    {
      numberid: '3',
      name: '京东',
      code: 'JD245001-01',
      productCode: '245001-01',
      productName: '商品名称',
      productStatus: true,
      color: '红色',
      size: '大',
      type: '经典',
    },
    {
      numberid: '4',
      name: '京东',
      code: 'JD245001-01',
      productCode: '245001-01',
      productName: '商品名称',
      productStatus: false,
      color: '红色',
      size: '大',
      type: '经典',
    },
  ];
  return res.json(data);
}

function getTypes(_req: Request, res: Response) {
  const data = [
    {
      numberid: '1',
      typeCode: '10000001',
      typeName: '10000001',
    },
    {
      numberid: '2',
      typeCode: '10000001',
      typeName: '10000001',
    },
    {
      numberid: '3',
      typeCode: '10000001',
      typeName: '10000001',
    },
    {
      numberid: '4',
      typeCode: '10000001',
      typeName: '10000001',
    },
  ];
  return res.json(data);
}
